package com.banmoon.decorator.optimize;

import cn.hutool.core.util.StrUtil;
import lombok.Getter;

@Getter
public abstract class Decorator extends Drink {

    private Drink drink;

    public Decorator(Drink drink) {
        this.drink = drink;
    }

    @Override
    public String getDesc(){
        return StrUtil.format("{} | {}", super.getDesc(), drink.getDesc());
    }

    @Override
    public Float cost(){
        return super.getPrice() + drink.cost();
    }
}
